<!--<script type="text/javascript">jQuery.noConflict()</script>-->

<script type="text/javascript" language="javascript" src="<?php echo base_url() ?>media/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="<?php echo base_url() ?>media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
        $('#example').dataTable();
    } );

</script>

<link media="screen" rel="stylesheet" href="<?php echo base_url(); ?>css/colorbox.css" />
<!--<script src="<?php echo base_url(); ?>jscripts/jquery-latest.min.js" type="text/javascript"></script>-->
<script src="<?php echo base_url(); ?>jscripts/jquery.colorbox-min.js" type="text/javascript"></script>

<!--the end of popup-->
<script type="text/javascript">
    $(function()
    {
        $('#link_content').colorbox({opacity:0.3});

    });
</script>
<!--this is the end of stylesheet-->
<!--end search -->

<style type="text/css" title="currentStyle">
    @import "<?php echo base_url() ?>media/css/demo_page.css";
    @import "<?php echo base_url() ?>media/css/demo_table.css";
</style>
<div style="margin: 0 auto;width: 100%;height: auto;border: 0px #ccc solid;text-align: center;font-size: 20px;color:#5C9416;">User Management</div><br/>
<div class="Tcontrol" style="margin-bottom: 5px; margin: 0 auto; float: right;width:70px;height: auto;border: 1px #ccc solid;text-align: center;font-size: 20px;color:#006600;">
    <center><?php echo anchor('user/add', img('images/icon-32-new.png'), array('id' => 'link_content')); ?><br/>
        <span style="font-size: 9px;">Add New</span></center>
</div><br/><br/>
<?php
if ($this->session->userdata('ms')) {
    echo $this->session->userdata('ms');
    $this->session->unset_userdata('ms');
} else if ($this->session->userdata('edit_ms')) {
    echo $this->session->userdata('edit_ms');
    echo$this->session->unset_userdata('edit_ms');
} else if ($this->session->userdata('del_ms')) {
    echo $this->session->userdata('del_ms');
    echo$this->session->unset_userdata('del_ms');
}
?>
<div class="task1" style="float: left; width: 100%;height: auto;border: 0px #ccc solid;padding: 5px;">
    <div class="full_width big"></div>
    <div id="demo">
        <table cellpadding="0" cellspacing="0" border="0" class="mytable" id="example" width="100%">
            <thead>
                <tr style="background-color:#5C9416;color:#FFF;border:1px;text-align: center;font-weight: lighter;">
                    <th>N&ordm;</th>
                    <th>Name</th>
                    <th>Gender</th>
                    <th>Email</th>
                    <th>Action</th>
                </tr>
            </thead>
            <tbody>
                <?php
                $j = 1;
                $query_student = $this->db->get('tbl_user');
                foreach ($query_student->result() as $rows) {
                    ?>
                    <tr style="border:1px;text-align: center;font-weight: lighter;">
                        <td><?php echo $j; ?></td>
                        <td><?php echo $rows->use_username; ?></td>
                        <td><?php echo $rows->use_sex; ?></td>
                        <td><?php echo $rows->use_email; ?></td>
                        <td>
                            <?php
                            $admin = $this->session->userdata('user_type');
                            if ($admin == '1') {
                                echo anchor('user/edit/' . $rows->use_id, img(array('src' => 'images/web_images/icon-16-edit2.png', 'alt' => 'Edit', 'title' => 'Edit'))) . '&nbsp;|&nbsp;' . anchor('user/delete/' . $rows->use_id, img(array('src' => 'images/web_images/icon-16-delete2.png', 'alt' => 'Delte', 'title' => 'Delete')), 'onclick="return confirm(\'Do you want to delete?\')"');
                            } else {
                                echo anchor('user/edit/' . $rows->use_id, img(array('src' => 'images/web_images/icon-16-edit2.png', 'alt' => 'Edit', 'title' => 'Edit'))) . '&nbsp;|&nbsp;' . anchor('user/delete/' . $rows->use_id, img(array('src' => 'images/web_images/icon-16-delete2.png', 'alt' => 'Delte', 'title' => 'Delete')), 'onclick="return confirm(\'Do you want to delete?\')"');
                            }
                            $j++;
                            ?>
                        </td>
                    </tr>


                <?php } ?>
            </tbody>
        </table>
    </div>
    <div class="spacer"></div>


    <h1>&nbsp;</h1>
    <h1>&nbsp;</h1>
</div>

